package com.myworld;

import com.myworld.utils.IdWorker;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @EnableScheduling:
 * 		开启spring任务调度
 */
@EnableScheduling
@SpringBootApplication
@MapperScan("com.myworld.mapper")
public class MybootApplication {

	public static void main(String[] args) {
		SpringApplication.run(MybootApplication.class, args);
	}
	
	//分布式系统产生id
	@Bean
    public IdWorker idWorker() {
        return new IdWorker(0, 0);  //这两个数可以在系统中设置
    }
}
